home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1984 June / 1984-06.d64 / shape match (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  5KB  |  144 lines

  1. 50 rem **           initialize       **
  2. 52 dim cl(20,40)
  3. 53 print"[147]":sys65517:wi=peek(781):ifwi=22thenwi=0:poke36879,238:ss=2:ph=.5
  4. 54 if wi=0thenaa$="vic":bb$="vic":goto60
  5. 55 poke53280,1:poke53281,15:ss=12:wi=8:ph=1
  6. 57 aa$="64[157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157][157]":bb$="64"
  7. 60 if wi=0 then cl(4,18)=1:cl(4,31)=2:cl(10,18)=3:cl(10,31)=4:goto80
  8. 63 fora=6to12step6:forb=17to33step16:s=646:pokes,ss
  9. 70 t=t+1:cl(a,b)=t:nextb,a
  10. 80 print"";:printtab(wi+5)"[144]shape match"
  11. 190 gosub3000:rem **  instructions   **
  12. 200 gosub1000:rem ** print board **
  13. 210 fort=1to1000:next
  14. 300 rem *******************************
  15. 302 rem **        select shapes      **
  16. 305 rem *******************************
  17. 306 k=rnd(-ti)
  18. 310 k=int(rnd(0)*4)+1:ifk=kkthen310
  19. 320 rem
  20. 340 fort=1to3:gosub2000:bo$=sh$(t):a=4+t:b=18:print"":gosub1170:next t
  21. 345 gosub1180:rem **      delay      **
  22. 348 ifwi=0thenfort=1to3:gosub2100:bo$=sh$(t):a=4+t:b=32:print""
  23. 349 ifwi=0thengosub1170:nextt:goto355
  24. 350 fort=1to3:gosub2100:bo$=sh$(t):a=4+t:b=28:print"":gosub1170:next t
  25. 355 gosub1180
  26. 360 fort=1to3:gosub2200:bo$=sh$(t):a=10+t:b=18:print"":gosub1170:next t
  27. 365 gosub1180
  28. 370 fort=1to3:gosub2300:bo$=sh$(t):a=10+t:b=28:print"":gosub1170:next t
  29. 375 gosub1180
  30. 380 fort=1to3
  31. 383 onkgosub2000,2100,2200,2300
  32. 385 bo$=sh$(t):a= 8+t:b=3:print"":gosub1170:next t:kk=k
  33. 500 rem
  34. 550 rem end
  35. 600 rem *******************************
  36. 602 rem **          move cursor      **
  37. 604 rem *******************************
  38. 605 print"":c=1:fornt=1to10
  39. 610 fort=1to15:bo$=chr$(63):ift/2=int(t/2)then bo$=chr$(18)+chr$(63)+chr$(146)
  40. 613 if wi=0then on c goto 660,673,683,687
  41. 615 onc goto670,675,680,685
  42. 620 gosub1170:print"":fortt=1to 75:        nexttt:goto700
  43. 625 next t
  44. 630 bo$=chr$(32):gosub1170:print"":        fortt=1to 75:nexttt:c=c+1
  45. 640 ifc>4thenc=1
  46. 650 nextnt:goto600:rem **  repeat  **
  47. 660 a=4:b=18:l=1:goto620
  48. 670 a=6:b=17:l=1:goto620
  49. 673 a=10:b=18:l=2:goto620
  50. 675 a=12:b=17:l=2:goto620
  51. 680 a=6:b=33:l=3:goto620
  52. 683 a=4:b=31:l=3:goto620
  53. 685 a=12:b=33:l=4:goto620
  54. 687 a=10:b=31:l=4:goto620
  55. 700 rem *******************************
  56. 702 rem **     check for response    **
  57. 704 rem *******************************
  58. 710 geta$:ifa$=""then 625
  59. 715 if a$="q"then print"[147]":end
  60. 720 ifcl(a,b)=k then800:rem correct
  61. 740 goto850: rem **  wrong    **
  62. 800 rem *******************************
  63. 802 rem **         correct answer    **
  64. 804 rem *******************************
  65. 810 bo$="yes! that's right!":a=18:gosub1174:print""
  66. 820 bo$="[152][144] press any key [146]":a=20:gosub1174:print""
  67. 825 geta$:ifa$=""then825
  68. 830 fora=1to23:bo$="                                        ":b=0:gosub1170
  69. 835 print"":next
  70. 840 goto200:rem **  re-print board  **
  71. 850 rem *******************************
  72. 852 rem **           wrong answer    **
  73. 854 rem *******************************
  74. 855 bo$=chr$(32):gosub1170:print""
  75. 860 bo$="[152][144]sorry...try again...[146]":       a=18:b=10:gosub1174:print""
  76. 865 forw=1to1000:next
  77. 870 bo$="                      ":a=18:      b=10:gosub1174:print""
  78. 875 c=c+1:ifc>4thenc=1
  79. 880 goto 625
  80. 999 rem  ******************************
  81. 1000 print"[147]"
  82. 1015 ifwi=0thenbo$=" [176][192][192][192][192][192][178][192][192][192][192][192][174]":a=3:b=15:gosub 1170:print"":goto1030
  83. 1020 a=3:b=15:bo$="[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174][146]":gosub1170:print""
  84. 1025 rem
  85. 1030 fort=1to5:a=3+t:b=15
  86. 1035 if wi=0thenbo$=" [221][146]     [221][146]     [221][146]":gosub1170:print"":goto1045
  87. 1040 bo$="[194][146]         [194][146]         [194][146]":gosub1170:print""
  88. 1045 next t
  89. 1047 ifwi=0thena=9:b=15:bo$=" [171][192][192][192][192][192][219][192][192][192][192][192][179][146]":gosub1170:print"":goto1060
  90. 1050 a=9:b=15:bo$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179][146]":gosub1170:print""
  91. 1060 fort=1to5:a=9+t:b=15
  92. 1065 ifwi=0thenbo$=" [221][146]     [221][146]     [221][146]":gosub1170:print"":goto1073
  93. 1070 bo$="[194][146]         [194][146]         [194][146]":gosub1170:print""
  94. 1073 nextt
  95. 1078 a=15:b=15:ifwi=0thenbo$=" [173][192][192][192][192][192][177][192][192][192][192][192][189][146]":gosub1170:print"":goto1090
  96. 1080 bo$="[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189][146]":gosub1170:print""
  97. 1090 bo$=t$:a=20:b=13:gosub1170:print""
  98. 1093 printtab(wi)"  type (q) to quit."
  99. 1095 return
  100. 1100 rem **************************+***
  101. 1110 rem **           print          **
  102. 1111 rem ******************************
  103. 1170 fori=1toa:print"";:next:printtab(b*ph)bo$:return
  104. 1174 fori=1toa:print"";:next:printtab(wi)bo$:return
  105. 1175 rem
  106. 1180 forx=1to500:next:return
  107. 2000 rem
  108. 2015 sh$(1)=" [184][184][184]"
  109. 2020 sh$(2)="    "
  110. 2025 sh$(3)="    ":return
  111. 2100 rem
  112. 2115 sh$(1)="[156] "
  113. 2120 sh$(2)="   "
  114. 2125 sh$(3)=" ":return
  115. 2200 rem
  116. 2215 sh$(1)="[144][169]"
  117. 2220 sh$(2)="[169] "
  118. 2225 sh$(3)="[169]  ":return
  119. 2300 rem
  120. 2315 sh$(1)="[169][223]"
  121. 2320 sh$(2)="[169]  [223]"
  122. 2325 ifwi=8thensh$(3)="[169]    [223]":return
  123. 2330 sh$(3)="":return
  124. 3000 print"";:printtab(wi)"  instructions (y/n) ?"
  125. 3020 geta$:ifa$=""then3020
  126. 3030 ifa$="n"then3200
  127. 3040 ifa$="y"thenprint"[147]":goto 3100
  128. 3050 goto3020
  129. 3100 printtab(wi)"in shape match,the "aa$;:printtab(wi)"will print a shape on"
  130. 3110 printtab(wi)"the left side of the":printtab(wi)"screen. the student"
  131. 3115 printtab(wi)"will find 4 different":printtab(wi)"shapes on the right"
  132. 3120 printtab(wi)"side of the screen,":printtab(wi)"one of which will"
  133. 3130 printtab(wi)"match the shape on":printtab(wi)"the left."
  134. 3140 printtab(wi)"when the ?[146] is":printtab(wi)"next to the shape he"
  135. 3150 printtab(wi)"or she thinks is":printtab(wi)"correct, the student"
  136. 3155 printtab(wi)"should press any key."
  137. 3156 printtab(wi)"the ";bb$;" will evaluate"
  138. 3160 printtab(wi)"the answer and let":printtab(wi)"the student know how"
  139. 3165 printtab(wi)"he did. type q[146] to":printtab(wi)"end the program."
  140. 3190 printtab(wi)"press any key to play";
  141. 3195 geta$:ifa$=""then3195
  142. 3196 print"[147]"chr$(142)
  143. 3200 return
  144.